package com.cd.service.user;

import java.util.List;
import com.cd.bean.User;

/**
 * 管理员（用户）接口
 *@Author zhk
 *@Date 2018-1-12
 **/
public interface UserService {
	/**
	 * 新增
	 * @param user
	 * @throws Exception
	 */
	public void save(User user) throws Exception;
	/**
	 * 通过id删除
	 * @param id
	 * @throws Exception
	 */
	public void delete(Integer id) throws Exception;
	/**
	 * 更新
	 * @param user
	 * @throws Exception
	 */
	public void edit(User user) throws Exception;
	/**
	 * 查询列表（全部）
	 * @return list
	 * @throws Exception
	 */
	public List<User> listAll() throws Exception;
	/**
	 * 通过id获取
	 * @param id
	 * @return user
	 * @throws Exception
	 */
	public User findById(Integer id) throws Exception;
	/**
	 * 批量删除
	 * @param id
	 * @throws Exception
	 */
	public void deleteAll() throws Exception;
	/**
	 * 返回记录总数
	 * @return int
	 * @throws Exception
	 */
	public Integer size() throws Exception;
	/**
	 * 通过用户名和密码查找
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public User findByUsernameAndPwd(User user) throws Exception;
	/**
	 * 修改密码
	 * @param user
	 * @throws Exception
	 */
	public void updatePasswordById(User user) throws Exception;
	/**
	 * 通过用户名查询
	 * @return
	 * @throws Exception
	 */
	public User findByUsername(String username) throws Exception;
}
